<template>
  <div>
    {{  c  }}
    <p>Has published books:</p>
    {{ publishedBooksMessage   }}
    {{  funpublishedBooksMessage()   }}

    {{ publishedBooksMessage   }}
    {{  funpublishedBooksMessage()   }}

    {{ publishedBooksMessage   }}
    {{  funpublishedBooksMessage()   }}
    
  </div>
</template>
<script   setup>
import { computed, ref } from "vue";

const a =ref(0);
const b =ref(0);

const author  = ref({  
  name: 'John Doe',
  books: [
    'Vue 2 - Advanced Guide',
    'Vue 3 - Basic Guide',
    'Vue 4 - The Mystery'
  ]
})

const c =  computed(  _=> a.value + b.value )



const publishedBooksMessage  =    computed( _ => {
  console.log("computed");
  return  author.value.books.length >0 ? 'Yes':'No'

})

const funpublishedBooksMessage =  _ =>{
  console.log("funcation");
  return  author.value.books.length >0 ? 'Yes':'No'

} 
  // _=>{}
 
</script>
 